package com.suliu.practice.io;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class FileReaderWriterTest {

	public static void main(String[] args) throws IOException {
//		FileReader fr=new FileReader("D:/workspace/java-practice/src/com/suliu/practice/io/FileReaderTest.java");//class文件读取源文件
//		BufferedReader br=new BufferedReader(fr);
//		String str;
//		while(null!=(str=br.readLine())){
//			System.out.println(str);
//		}
//		br.close();
		
		String str="hello";
		char[] buffer=new char[str.length()];
		str.getChars(0, str.length(), buffer, 0);
		FileWriter fw=new FileWriter("file.txt");
		for(int i=0;i<buffer.length;i++){
			fw.write(buffer[i]);
		}
		fw.close();
	}

}
